<?php

namespace app\admin\model\pt;

use think\Model;


class Job extends Model
{





    // 表名
    protected $name = 'pt_job';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];

    public function getJobStatusList()
    {
        //1-待编辑,2-待处理,3-待归档,4-归档待验收,5-验收待发布,6-已发布,9-已取消
        return [
            '1' => '待编辑',
            '2' => '待处理',
            '3' => '待归档',
            '4' => '归档待验收',
            '5' => '验收待发布',
            '6' => '已发布',
            '9' => '已取消'
        ];
    }

    public function jobRecords()
    {
        return $this->hasMany('JobRecord', 'job_id', 'id')->order('create_time desc');
    }

    /**
     * 关联订单
     */
    public function order()
    {
        return $this->belongsTo('app\admin\model\pt\Order', 'order_id', 'id');
    }








}
